CC=g++
CFLAGS=-Wall -O2
SAMDIR=../third-party/samtools-0.1.18/

test: Node.o HLATree.o BamReader.o test.o MSFReader.o
	$(CC) -L ${SAMDIR} -o test test.o Node.o HLATree.o BamReader.o -lbam -lz MSFReader.o

test.o: test.cpp
	$(CC) ${CFLAGS} -lz -I../third-party -I ${SAMDIR}  -c -o test.o test.cpp

Node.o : Node.cpp Node.h
	$(CC) ${CFLAGS} -c -o Node.o Node.cpp

HLATree.o: HLATree.cpp HLATree.h
	$(CC) ${CFLAGS} -I../third-party -I ${SAMDIR} -lbam -lz -c -o HLATree.o HLATree.cpp

BamReader.o: BamReader.cpp BamReader.h
	$(CC) ${CFLAGS} -I ${SAMDIR} -L ${SAMDIR} -c -o BamReader.o BamReader.cpp -lbam -lz 
#g++ -Wall -O2 -o BamReader.o -I ../third-party/samtools-0.1.18/ -L ../third-party/samtools-0.1.18/ BamReader.cpp -lbam -lz

MSFReader.o: MSFReader.cpp MSFReader.h
	$(CC) ${CFLAGS} -c -o MSFReader.o MSFReader.cpp
  
#calDepth:../libbam.a calDepth.c
#                $(CC) -g -Wall -O2 -I.. calDepth.c -o $@ -L.. -lbam -lm -lz

clean: 
	rm test test.o Node.o HLATree.o BamReader.o test 
